package com.cybertron.ironhide.manage.common.auth.admin;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.shiro.authc.AuthenticationToken;

import com.cybertron.ironhide.manage.common.auth.CaptchaFormAuthenticationFilter;

public class AdminFormAuthenticationFilter extends
		CaptchaFormAuthenticationFilter {

	public AdminFormAuthenticationFilter() {
		super();
	}

	@Override
	protected AuthenticationToken createToken(ServletRequest request,
			ServletResponse response) {
		String username = getUsername(request);
		String password = getPassword(request);
		String captcha = getCaptcha(request);
		boolean rememberMe = isRememberMe(request);
		String host = getHost(request);
		return new AdminUsernamePasswordToken(username, password, rememberMe,
				host, captcha);
	}
}
